﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
using System.Windows.Forms;
using DatabaseCore;
using SystemCore;

namespace EakTest
{
    public partial class OrderQueue : BaseForm
    {
        IOrderDao orderDao = new OrderDao();
        //IOrderHistoryDao orderHistoryDao = new OrderHistoryDao();
        IOrderDetailDao orderDetailDao = new OrderDetailDao();
        //IOrderDetailHistoryDao orderDetailHistoryDao = new OrderDetailHistoryDao();

        private tbl_Order OrderDataSource { get; set; }
        private IList<tbl_OrderDetail> OrderDetailDataSource { get; set; }

        string orderNo = "071013000003"; //300913000002
        private int testStock = 10000;

        public OrderQueue()
        {
            InitializeComponent();

            GetOrder();
        }

        #region Event

        #region Override method

        public override void SaveDraft()
        {
            //SaveOrder(EOrderStatus.Order);
        }

        public override void SendApprove()
        {
            //SaveOrder(EOrderStatus.WaitForApprove);
        }

        #endregion

        #region Button Click

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            //BindData();
        }

        #endregion

        #endregion

        #region Private method

        private void GetOrder()
        {
            OrderDataSource = orderDao.GetByKey(orderNo);
        }

        private void ClearGridView()
        {
            gvOrderDetail.Rows.Clear();
            gvOrderDetail.DataSource = null;
        }

        #endregion

        

    }
}
